﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TechnicRequestsExt>" %>
<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TechnicRequestsExt>" %>--%>
<%@ Import Namespace="CRM.Resourses" %>

<%
    var contactsCol = new CRM.Database.Model.ContactsCollection();
%>

<%
    Html.DevExpress().ComboBox(settings =>
    {
        settings.Name = "IdContact";
        settings.CallbackRouteValues = new { Controller = "TD", Action = "TechnicRequestContactPartial", key = Model.Key };
        settings.Width = 496;
        settings.Properties.EnableCallbackMode = true;
        settings.Properties.ValueField = "IdContact";
        settings.Properties.ValueType = typeof(int);
        settings.Properties.Columns.Add("Name", Resourses.Name, Unit.Percentage(50));
        settings.Properties.Columns.Add("Phone", Resourses.Phone, Unit.Percentage(25));
        settings.Properties.Columns.Add("Email", Resourses.Email, Unit.Percentage(25));
        settings.Properties.DropDownWidth = 496;
        settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
        settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['LE'] = IdLegalEntity.GetValue(); }";
        settings.Properties.ClientSideEvents.EndCallback = "function(s, e) {IdAddress.PerformCallback();}";
    }).BindList(contactsCol.GetFullDefinedContactsByLegalEntityId(Model.IdLegalEntity)).Bind(Model.IdContact).GetHtml();
    //}).BindList(DB.GetFullDefinedContactsByLegalEntityId(Model.IdLegalEntity)).Bind(Model.IdContact).GetHtml();
%>
